import { createApp } from 'vue';
import App from './App.vue';
import PrimeVue from 'primevue/config';
import router from './router';
import store from './store';
import ToastService from 'primevue/toastservice'; // 引入 ToastService
import Toast from 'primevue/toast'; // 引入 Toast 组件

// primeVue样式
import "primeflex/primeflex.css";
import "primevue/resources/themes/aura-light-green/theme.css";
import "primevue/resources/primevue.min.css"; /* Deprecated */
import "primeicons/primeicons.css";
import ConfirmationService from 'primevue/confirmationservice';

import VueCookies from 'vue-cookies'
const app = createApp(App);

app.use(router);
app.use(VueCookies)
app.use(store);
app.use(ToastService); // 使用 ToastService
app.use(ConfirmationService);
app.component('Toast', Toast); // 注册 Toast 组件

// 先使用 PrimeVue，然后再挂载应用
app.use(PrimeVue, { ToastService });

// 最后挂载应用
app.mount('#app');